ActionScript 3.0 Game Programming University by Gary Rosenzweig

ActionScript 3.0 Game Programming University by Gary Rosenzweig

Author:Gary Rosenzweig
Language: eng
Format: epub, pdf
ISBN: 9780768689938
Publisher: Que


// two levels of sprites

var selectedPieces:Sprite;

var otherPieces:Sprite;

When players select a piece to drag, they could be selecting a single piece, or they could be selecting a group of linked pieces. So, instead of a single variable pointing to the piece being dragged, we need an array to store one or more pieces:

// pieces being dragged

var beingDragged:Array = new Array();

The game constructor function, in addition to calling loadBitmap, also creates the two sprites we need and adds them to the stage. The order in which these are added is important because we want the selectedPieces sprite to be on top of the otherPieces sprite:

// load picture and set up sprites

public function startJigsawPuzzle() {

// load the bitmap

loadBitmap("jigsawimage.jpg");



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.